﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections.ObjectModel;

namespace AutoLoL.Entities
{
    public class RafArchive
    {
        public Version Version { get; private set; }
        public string RafPath { get; private set; }
        public string DatPath { get { return RafPath + ".dat"; } }
        public byte[] Data { get; private set; }
        public ReadOnlyCollection<RafFile> Files { get; private set; }

        public RafArchive(Version version, string rafPath, byte[] data)
        {
            this.Version = version;
            this.RafPath = rafPath;
            this.Data = data;
        }

        public void SetFiles(ReadOnlyCollection<RafFile> files)
        {
            if (Files == null)
            {
                Files = files;
            }
            else
            {
                throw new Exception("Files can only be set once.");
            }
        }
    }
}
